import request from '@/utils/request'
// import store from '@/store'
// vue中使用：this.$store.state.属性名  js中：import store from '@/store'    store===this.$store   store.state.属性名
// 登录
export const authorizations = data => {
  return request({
    url: '/v1_0/authorizations',
    method: 'post',
    data,
    noToken: true
  })
}
// 获取用户个人资料
export const userProfile = () => {
  return request({
    url: '/v1_0/user/profile'
    // headers: {
    //   Authorization: 'Bearer ' + store.state.tokenObj.token
    // }
  })
}

// 编辑用户资料
// 接口规范  restFul规范   增post   删delete     改 全量修改put   部分修改 patch     查  get
export const userProfilePatch = data => {
  return request({
    url: '/v1_0/user/profile', // 地址不正确  %20
    method: 'patch',
    data
  })
}
// 头像上传
export const userPhotoPatch = data => {
  return request({
    url: '/v1_0/user/photo',
    method: 'patch',
    data
  })
}
